-
Notifications
You must be signed in to change notification settings - Fork 66
FXC-2087 Implement automatic structure extrusion for boundary waveports #2793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 files reviewed, 2 comments
f844379
to
8fcbe0b
Compare
afc9622
to
6ecc0eb
Compare
Diff CoverageDiff: origin/develop...HEAD, staged and unstaged changes
Summary
tidy3d/components/simulation.pyLines 5799-5807 5799 else:
5800 if direction == "-":
5801 del surfaces[2 * axis + 1]
5802 else:
! 5803 del surfaces[2 * axis]
5804
5805 structure = Structure(
5806 geometry=GeometryGroup(
5807 geometries=surfaces, Lines 5844-5853 5844 """Validate that after adding pec frames simulation setup is still valid."""
5845
5846 try:
5847 _ = self._finalized
! 5848 except Exception:
! 5849 log.error(
5850 "Simulation fails after requested mode source PEC frames are added. "
5851 "Please inspect '._finalized'."
5852 ) Lines 5864-5872 5864 length = obj.frame.length
5865 if direction == "+":
5866 span_inds[axis][1] += length - 1
5867 else:
! 5868 span_inds[axis][0] -= length - 1
5869 else:
5870 axis = obj.size.index(0.0)
5871
5872 # ensure that the pec frame is at least one cell larger than wave port plane |
a469ec2
to
f1007a7
Compare
67a0ba1
to
102b073
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there, a couple of comments + let's add an example where a waveguide assembly contains a geometry which is a union of two disjoint objects (something like GeometryGroup(geometries=[box_left, box_right])
, like a differential strip
7e11342
to
0d3abc3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looking like a good feature, just a couple of minor style comments.
c01d9fa
to
156ae24
Compare
156ae24
to
0e5cb72
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
0e5cb72
to
ba95248
Compare
ba95248
to
a80a406
Compare
a80a406
to
9f9b5ba
Compare
This PR adds automatic extrusion of structures intersecting waveports that are placed on boundaries.
Key changes:
This improves simulation accuracy when waveports are located on structure boundaries and simplifies user workflow.
Greptile Summary
Updated On: 2025-09-04 15:39:10 UTC
This PR implements automatic structure extrusion for waveports positioned on simulation boundaries. The main functionality adds a new
extrude_structures
boolean field to theWavePort
class that, when set toTrue
, triggers automatic extension of intersecting structures to ensure mode sources, internal absorbers, and PEC frames are fully contained within the material geometry.The core implementation resides in the
TerminalComponentModeler
class with the addition of a new_extrude_port_structures
method that performs the geometric operations. This method identifies structures intersecting the waveport plane and creates extendedPolySlab
geometries that stretch from the port location to cover all necessary simulation components. The extrusion logic handles complex geometries with holes usingClipOperation
and integrates seamlessly into the existing simulation pipeline.This feature addresses a common simulation accuracy issue where waveports placed directly on structure boundaries might not provide adequate material coverage for electromagnetic field calculations. By automating the extrusion process, the PR simplifies user workflow while ensuring proper containment of all port-related simulation elements.
Important Files Changed
Changed Files
Confidence score: 3/5
_extrude_port_structures
methodSequence Diagram